# 以 GBK 编码打开 d:\ceshi1.txt 文件以读取内容
with open(r'd:\ceshi1.txt', 'r', encoding='gbk') as read_file:
    content = read_file.read()

# 以 UTF - 8 编码打开 d:\ceshi2.txt 文件以写入内容
with open(r'd:\ceshi2.txt', 'w', encoding='utf-8') as write_file:
    write_file.write(content)

print("内容已成功从 d:\\ceshi1.txt 复制到 d:\\ceshi2.txt")